﻿@model BLL.SanPham

@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>


@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    
    <div class="form-horizontal">
        <h4>SanPham</h4>
        <hr />
        @Html.ValidationSummary(true)
        @Html.HiddenFor(model => model.MaSP)

        <div class="form-group">
            @Html.LabelFor(model => model.TenSP, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.TenSP)
                @Html.ValidationMessageFor(model => model.TenSP)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.GiaSP, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.GiaSP)
                @Html.ValidationMessageFor(model => model.GiaSP)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.DonViTinh, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.DonViTinh)
                @Html.ValidationMessageFor(model => model.DonViTinh)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.NhaSX, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.NhaSX)
                @Html.ValidationMessageFor(model => model.NhaSX)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.NgaySX, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextBoxFor(s => s.NgaySX, "{0:MM/dd/yyyy}", new { @class = "form-control", @id = "ngaysanxuat" })
                @Html.ValidationMessageFor(model => model.NgaySX)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.NgayHetHan, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextBoxFor(s => s.NgayHetHan, "{0:MM/dd/yyyy}", new { @class = "form-control", @id = "ngayhethan" })
                @Html.ValidationMessageFor(model => model.NgayHetHan)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.GioiThieuSP, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.GioiThieuSP)
                @Html.ValidationMessageFor(model => model.GioiThieuSP)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.GhiChu, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.GhiChu)
                @Html.ValidationMessageFor(model => model.GhiChu)
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Save" class="btn btn-default" />
            </div>
        </div>
    </div>
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>


@section scripts{

    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
@Scripts.Render("~/bundles/jqueryval")
    <script>
        $(function () {
            $("#ngayhethan").datepicker();
        });
        $(function () {
            $("#ngaysanxuat").datepicker();
        });
    </script>


}
